#ifndef _CONSTSTATEMENT_HPP
#define _CONSTSTATEMENT_HPP


#include <string>
#include "Statement.hpp"
#include "Token.hpp"
#include "Identifier.hpp"
#include "Expression.hpp"

using namespace std;

namespace ast {
	class ConstStatement : public Statement {
	public:

		ConstStatement(TOKEN token) {
			_token = token;
		}

		virtual void StatementNode() override {

		}

		virtual string tokenLiteral() override {
			return _token._literal;
		}

		virtual string String() override {
			string out;
			out.append(_token._literal);
			out.append(" ");
			out.append(_name->String());
			out.append(" = ");
			if (_value != nullptr) {
				out.append(_value->String());
			}
			out.append(";");
			return out;
		}

		virtual ~ConstStatement() {
			if (_name != nullptr) {
				delete _name;
			}
			if (_value != nullptr) {
				delete _value;
			}
		}

	public:
		TOKEN _token;
		Identifier* _name{ nullptr };
		Expression* _value{ nullptr };
	};
}

#endif // !_LETSTATEMENT_HPP